package com.fj.Test;

import com.fj.entity.Animal;
import com.fj.entity.Dog;
import com.fj.entity.Cat;

import java.awt.*;

/*
    @author:sa
    @date:2024/11/19 11:44
*/
public class Dt {
    public static void main(String[] args) {
//        Dog dog = new Dog();
        Animal dog = new Dog();
//        m1(dog);
        dog.eat();
        m1(dog);
//        Dog dogg = (Dog) dog;
//        dogg.kanjia();
//        Cat cat = new Cat();
//        cat.eat();
//        cat.zhuashu();
        Animal cat = new Cat();
        cat.eat();
        m1(cat);
    }

public static void m1(Animal dog) {
    dog.eat();
//        dog.play();
    Dog dogg = (Dog) dog;
    dogg.kanjia();
    ;
}
}